home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / srcuc.zip / ZONES.H < prev   
C/C++ Source or Header  |  1990-06-20  |  3KB  |  78 lines

  1. /* -*-C-*-
  2.  
  3. Copyright (c) 1987, 1988 Massachusetts Institute of Technology
  4.  
  5. This material was developed by the Scheme project at the Massachusetts
  6. Institute of Technology, Department of Electrical Engineering and
  7. Computer Science.  Permission to copy this software, to redistribute
  8. it, and to use it for any purpose is granted, subject to the following
  9. restrictions and understandings.
  10.  
  11. 1. Any copy made of this software must include this copyright notice
  12. in full.
  13.  
  14. 2. Users of this software agree to make their best efforts (a) to
  15. return to the MIT Scheme project any improvements or extensions that
  16. they make, so that these may be included in future releases; and (b)
  17. to inform MIT of noteworthy uses of this software.
  18.  
  19. 3. All materials developed as a consequence of the use of this
  20. software shall duly acknowledge such use, in accordance with the usual
  21. standards of acknowledging credit in academic research.
  22.  
  23. 4. MIT has made no warrantee or representation that the operation of
  24. this software will be error-free, and MIT is under no obligation to
  25. provide any services, by way of maintenance, update, or otherwise.
  26.  
  27. 5. In conjunction with products arising from the use of this material,
  28. there shall be no use of the name of the Massachusetts Institute of
  29. Technology nor of any adaptation thereof in any advertising,
  30. promotional, or sales literature without prior written consent from
  31. MIT in each case. */
  32.  
  33. /* $Header: zones.h,v 9.24 90/06/20 17:42:58 GMT cph Exp $
  34.  *
  35.  * Metering stuff.
  36.  * We break all times into time zones suitable for external analysis.
  37.  * Primitives may be included for accessing this information if desired
  38.  * by supplying additional files.
  39.  */
  40.  
  41. #ifdef METERING
  42. extern long New_Time, Old_Time, Time_Meters[], Current_Zone;
  43.  
  44. #ifdef ENABLE_DEBUGGING_TOOLS
  45. #define Set_Time_Zone(Zone)                        \
  46. {                                    \
  47.   New_Time = (OS_process_clock ());                    \
  48.   Time_Meters[Current_Zone] += New_Time-Old_Time;            \
  49.   Old_Time = New_Time;                            \
  50.   Current_Zone = Zone;                            \
  51. }
  52. #else
  53. #define Set_Time_Zone(Zone) Current_Zone = Zone;
  54. #endif
  55.  
  56. #define Save_Time_Zone(Zone)    Saved_Zone = Current_Zone; Set_Time_Zone(Zone);
  57. #define Restore_Time_Zone()    Set_Time_Zone(Saved_Zone);
  58. #else
  59. #define Set_Time_Zone(Zone)
  60. #define Save_Time_Zone(Zone)
  61. #define Restore_Time_Zone()
  62. #endif
  63.  
  64. #define Zone_Working 0
  65. #define Zone_GetWork 1
  66. #define Zone_TTY_IO 2
  67. #define Zone_Disk_IO 3
  68. #define Zone_Purify 4
  69. #define Zone_GCLoop 5
  70. #define Zone_Global_Int 6
  71. #define Zone_Store_Lock 7
  72. #define Zone_Math 8
  73. #define Zone_GCIdle 9
  74. #define Zone_Lookup 10
  75. #define Zone_Scheduler 11
  76.  
  77. #define Max_Meters 20
  78.